package com.example.springbootthread.lifecycle;

import java.util.concurrent.TimeUnit;

/**
 * @author : guorf
 * @version : v1.0
 * @description : TODO 线程不断休眠
 * @createTime : 2022/7/21 15:03
 */
public class WaitingTime implements Runnable {
    @Override
    public void run() {
        while (true) {
            waitSecond(200);
        }
    }

    // 线程等待多少秒
    public static final void waitSecond(long seconds) {
        try {
            TimeUnit.SECONDS.sleep(seconds);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
